﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="clientManager.aspx.cs" Inherits="clientManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>客户管理</title>
    <link href="css/shipping.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/cs.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../js/datePicker.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>
            <!--search condition -->
            <table id="searchTab" width="98%">
                <tr>
                    <td>
                        <table id="searchMain">
                            <tr class="b14Text">
                                <td style="width: 100px">
                                    <asp:Label ID="LabelByClient" runat="server" Text="客户:"></asp:Label></td>
                                <td>
                                    <asp:TextBox runat="server" ID="TextBoxClient" Width="220" autocomplete="off" CssClass="inputBox"
                                        Style="color: #999;" Text="输入名称中任意字,  '*'查询全部" onfocus="this.style.color='#000'; if(this.value.indexOf('输入') > -1){this.value='';}"
                                        onblur="if(this.value==''){this.value='输入名称中任意字,  \'*\'查询全部';this.style.color='#999';} else {this.style.color='#000';}" />
                                    <!-- 客户选择控件 Begin !-->
                                    <ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx" ID="autoComplete1"
                                        TargetControlID="TextBoxClient" ServicePath="../AutoComplete.asmx" ServiceMethod="GetClientList"
                                        MinimumPrefixLength="1" CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20"
                                        CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
                                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters=";, :">
                                        <Animations>
                                    <OnShow>
                                        <Sequence>
                                            <%-- Make the completion list transparent and then show it --%>
                                            <OpacityAction Opacity="0" />
                                            <HideAction Visible="true" />
                                            
                                            <%--Cache the original size of the completion list the first time
                                                the animation is played and then set it to zero --%>
                                            <ScriptAction Script="
                                                // Cache the size and setup the initial size
                                                var behavior = $find('AutoCompleteEx');
                                                if (!behavior._height) {
                                                    var target = behavior.get_completionList();
                                                    behavior._height = target.offsetHeight - 2;
                                                    target.style.height = '0px';
                                                }" />
                                            
                                            <%-- Expand from 0px to the appropriate size while fading in --%>
                                            <Parallel Duration=".4">
                                                <FadeIn />
                                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
                                            </Parallel>
                                        </Sequence>
                                    </OnShow>
                                    <OnHide>
                                        <%-- Collapse down to 0px and fade out --%>
                                        <Parallel Duration=".4">
                                            <FadeOut />
                                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
                                        </Parallel>
                                    </OnHide>
                                        </Animations>
                                    </ajaxToolkit:AutoCompleteExtender>
                                    <!-- 客户选择控件 End !-->
                                    登录名: <asp:TextBox ID="TextBoxClientCode" runat="server" CssClass="input"></asp:TextBox>
                                </td>
                                <td>
                                    <span style="color: Green">客户定义</span></td>
                            </tr>
                            <tr class="b14Text">
                                <td style="width: 100px">
                                    销售代表:
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownListUser" runat="server" DataTextField="user_name"
                                        DataValueField="user_id" AppendDataBoundItems="True">
                                        <asp:ListItem Value="-1">全部</asp:ListItem>
                                    </asp:DropDownList>
                                    状态:
                                    <asp:DropDownList ID="DropDownListClientStatus" runat="server" CssClass="input">
                                                <asp:ListItem Value="-1">全部</asp:ListItem>
                                                <asp:ListItem Selected="True">正常</asp:ListItem>
                                                <asp:ListItem>潜在</asp:ListItem>
                                                <asp:ListItem>清理</asp:ListItem>
                                    </asp:DropDownList>
                                    市场:
                                    <asp:DropDownList ID="DropDownListMarketType" runat="server">
                                        <asp:ListItem Value="-1">全部</asp:ListItem>
                                        <asp:ListItem Value="1">内销</asp:ListItem>
                                        <asp:ListItem Value="3">门市</asp:ListItem>
                                        <asp:ListItem Value="4">零配</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr class="b14Text">
                                <td style="width: 100px">
                                    省:
                                </td>
                                <td>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <asp:DropDownList ID="DropDownListState" runat="server" CssClass="input" DataTextField="stateName"
                                                DataValueField="stateID" AppendDataBoundItems="True" AutoPostBack="True" OnSelectedIndexChanged="DropDownListState_SelectedIndexChanged">
                                                <asp:ListItem Value="">请选择...</asp:ListItem>
                                            </asp:DropDownList>
                                            市:
                                            <asp:DropDownList ID="DropDownListCity" runat="server" CssClass="input" DataTextField="cityName"
                                                DataValueField="cityID" AppendDataBoundItems="True" AutoPostBack="True">
                                                <asp:ListItem Value="">请选择...</asp:ListItem>
                                            </asp:DropDownList>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </td>
                                <td>
                                    <asp:Button ID="ButtonQuery" runat="server" OnClick="ButtonQuery_Click" Text="查询"
                                        CssClass="button" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="LabelResultCount" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="1"
                CellSpacing="1" BorderWidth="0px" BackColor="#C6D5DC" CssClass="biaoresult" AllowPaging="True"
                Width="98%" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="25" OnRowCommand="GridView1_RowCommand">
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <EditRowStyle BackColor="#999999" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField DataField="client_code" HeaderText="登录名" />
                    <asp:BoundField DataField="client_name" HeaderText="客户名称" ItemStyle-Width="300" />
                    <asp:BoundField DataField="area" HeaderText="区域" />
                    <asp:BoundField DataField="state" HeaderText="省" />
                    <asp:BoundField DataField="city" HeaderText="市" />
                    <asp:BoundField DataField="client_status" HeaderText="状态" />
                    <asp:BoundField DataField="client_type_name" HeaderText="类型" />
                    <asp:BoundField DataField="user_name" HeaderText="销售代表" />
                    <asp:BoundField DataField="disp_client_create_date" HeaderText="创建日期" />
                    <asp:TemplateField HeaderText="" ShowHeader="False">
                        <ItemTemplate>
                            <a href="clientEdit.aspx?clientID=<%#Eval("client_id")%>">修改 </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="visible" HeaderText="可见" />
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButtonSetVisible" runat="server" CausesValidation="False" Text="改变"
                                        CommandArgument='<%# Eval("client_id") %>' CommandName="command_visible"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>                    
                </Columns>
            </asp:GridView>
            &nbsp;&nbsp;<a href="clientEdit.aspx">新建客户</a>
        </div>
    </form>
</body>
</html>
